/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import control.AdminKontrol;
import java.sql.SQLException;
import java.util.List;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JOptionPane;
import model.Divisi;
import model.KategoriMenu;
import model.Menu;
import model.Pegawai;
import tabelmodel.DivisiTableModel;
import tabelmodel.KategoriMenuTableModel;
import tabelmodel.MenuTableModel;
import tabelmodel.PegawaiTableModel;

/**
 *
 * @author Asus
 */
public class frameAdmin extends javax.swing.JFrame {

    /**
     * Creates new form frameAdmin1
     */
    
    public frameAdmin() {
        initComponents();
        tampilKategoriMenu();
        tampilMenu();
        tampilDivisi();
        tampilPegawai();
        tampilComboDivisi();
        tampilComboKategori();
        textIdDivisi.setEditable(false);
        textIdKategori.setEditable(false);
        textIdMenu.setEditable(false);
        textIdPegawai.setEditable(false);
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jDesktopPane1 = new javax.swing.JDesktopPane();
        jPanel1 = new javax.swing.JPanel();
        labelFrameAdmin = new javax.swing.JLabel();
        tombolKeluarAdmin = new javax.swing.JButton();
        tabDataAdmin = new javax.swing.JTabbedPane();
        tabKategoriMenu = new javax.swing.JPanel();
        labelKategoriMenu = new javax.swing.JLabel();
        jScrollPane30 = new javax.swing.JScrollPane();
        tabelKategoriMenu = new javax.swing.JTable();
        tombolTambahKategori = new javax.swing.JButton();
        tombolHapusKategori = new javax.swing.JButton();
        tombolKembalikanKategori = new javax.swing.JButton();
        tabMenu = new javax.swing.JPanel();
        labelMenu = new javax.swing.JLabel();
        jScrollPane31 = new javax.swing.JScrollPane();
        tabelMenu = new javax.swing.JTable();
        tombolTambahMenu = new javax.swing.JButton();
        tombolKembalikanMenu = new javax.swing.JButton();
        tombolHapusMenu = new javax.swing.JButton();
        tabDivisi = new javax.swing.JPanel();
        labelDivisi = new javax.swing.JLabel();
        jScrollPane34 = new javax.swing.JScrollPane();
        tabelDivisi = new javax.swing.JTable();
        tombolTambahDivisi = new javax.swing.JButton();
        tombolHapusDivisi = new javax.swing.JButton();
        tombolKembalikanDivisi = new javax.swing.JButton();
        tabPegawai = new javax.swing.JPanel();
        labelPegawai = new javax.swing.JLabel();
        tombolTambahPegawai = new javax.swing.JButton();
        tombolHapusPegawai = new javax.swing.JButton();
        jScrollPane44 = new javax.swing.JScrollPane();
        tabelPegawai = new javax.swing.JTable();
        tombolKembalikanPegawai = new javax.swing.JButton();
        inFramePengisianKategori = new javax.swing.JInternalFrame();
        labelPengisianKategori = new javax.swing.JLabel();
        labelIdKat = new javax.swing.JLabel();
        labelNamaKat = new javax.swing.JLabel();
        textIdKategori = new javax.swing.JTextField();
        textNamaKategori = new javax.swing.JTextField();
        tombolSimpanPengisianKategori = new javax.swing.JButton();
        tombolKembaliPengisianKategori = new javax.swing.JButton();
        inFramePengisianMenu = new javax.swing.JInternalFrame();
        labelPengisianMenu = new javax.swing.JLabel();
        labelIdMenu = new javax.swing.JLabel();
        labelNamaMenu = new javax.swing.JLabel();
        labelKategori = new javax.swing.JLabel();
        labelHarga = new javax.swing.JLabel();
        textIdMenu = new javax.swing.JTextField();
        textNamaMenu = new javax.swing.JTextField();
        comboKategori = new javax.swing.JComboBox();
        textHarga = new javax.swing.JTextField();
        tombolSimpanPengisianMenu = new javax.swing.JButton();
        tombolKembaliPengisianMenu = new javax.swing.JButton();
        inFramePengisianDivisi = new javax.swing.JInternalFrame();
        labelIdDivisi = new javax.swing.JLabel();
        labelNamaDivisi = new javax.swing.JLabel();
        textIdDivisi = new javax.swing.JTextField();
        textNamaDivisi = new javax.swing.JTextField();
        tombolSimpanPengisianDivisi = new javax.swing.JButton();
        labelPengisianDivisi = new javax.swing.JLabel();
        tombolKembaliPengisianDivisi = new javax.swing.JButton();
        inFramePengisianPegawai = new javax.swing.JInternalFrame();
        labelPengisianPegawai = new javax.swing.JLabel();
        labelIdPegawai = new javax.swing.JLabel();
        labelNamaPegawai = new javax.swing.JLabel();
        labelUsername = new javax.swing.JLabel();
        labelPassword = new javax.swing.JLabel();
        labelDivisiPegawai = new javax.swing.JLabel();
        textIdPegawai = new javax.swing.JTextField();
        textNamaPegawai = new javax.swing.JTextField();
        comboDivisi = new javax.swing.JComboBox();
        textUsername = new javax.swing.JTextField();
        tombolSimpanPengisianPegawai = new javax.swing.JButton();
        tombolKembaliPengisianPegawai = new javax.swing.JButton();
        textPassword = new javax.swing.JPasswordField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        getContentPane().setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        labelFrameAdmin.setText("FRAME ADMIN");

        tombolKeluarAdmin.setText("KELUAR");
        tombolKeluarAdmin.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKeluarAdminActionPerformed(evt);
            }
        });

        tabKategoriMenu.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        labelKategoriMenu.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        labelKategoriMenu.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelKategoriMenu.setText("Kategori Menu");
        tabKategoriMenu.add(labelKategoriMenu, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 10, -1, -1));

        tabelKategoriMenu.setAutoCreateRowSorter(true);
        tabelKategoriMenu.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Kategori ", "Nama Kategori"
            }
        ));
        tabelKategoriMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelKategoriMenuMouseClicked(evt);
            }
        });
        jScrollPane30.setViewportView(tabelKategoriMenu);

        tabKategoriMenu.add(jScrollPane30, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 70, 710, 160));

        tombolTambahKategori.setText("Tambah");
        tombolTambahKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolTambahKategoriActionPerformed(evt);
            }
        });
        tabKategoriMenu.add(tombolTambahKategori, new org.netbeans.lib.awtextra.AbsoluteConstraints(120, 340, 90, -1));

        tombolHapusKategori.setText("Hapus");
        tombolHapusKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolHapusKategoriActionPerformed(evt);
            }
        });
        tabKategoriMenu.add(tombolHapusKategori, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 340, 89, -1));

        tombolKembalikanKategori.setText("Kembalikan");
        tombolKembalikanKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembalikanKategoriActionPerformed(evt);
            }
        });
        tabKategoriMenu.add(tombolKembalikanKategori, new org.netbeans.lib.awtextra.AbsoluteConstraints(530, 340, 110, -1));

        tabDataAdmin.addTab("KategoriMenu", tabKategoriMenu);

        labelMenu.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        labelMenu.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelMenu.setText("Menu");

        tabelMenu.setAutoCreateRowSorter(true);
        tabelMenu.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null},
                {null, null, null, null}
            },
            new String [] {
                "Id Menu", "Nama Menu", "Kategori", "Harga"
            }
        ));
        tabelMenu.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelMenuMouseClicked(evt);
            }
        });
        jScrollPane31.setViewportView(tabelMenu);

        tombolTambahMenu.setText("Tambah");
        tombolTambahMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolTambahMenuActionPerformed(evt);
            }
        });

        tombolKembalikanMenu.setText("Kembalikan");
        tombolKembalikanMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembalikanMenuActionPerformed(evt);
            }
        });

        tombolHapusMenu.setText("Hapus");
        tombolHapusMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolHapusMenuActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout tabMenuLayout = new javax.swing.GroupLayout(tabMenu);
        tabMenu.setLayout(tabMenuLayout);
        tabMenuLayout.setHorizontalGroup(
            tabMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabMenuLayout.createSequentialGroup()
                .addGroup(tabMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(tabMenuLayout.createSequentialGroup()
                        .addContainerGap()
                        .addComponent(jScrollPane31))
                    .addGroup(tabMenuLayout.createSequentialGroup()
                        .addGap(333, 333, 333)
                        .addComponent(labelMenu)
                        .addGap(233, 355, Short.MAX_VALUE))
                    .addGroup(tabMenuLayout.createSequentialGroup()
                        .addGap(116, 116, 116)
                        .addComponent(tombolTambahMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(112, 112, 112)
                        .addComponent(tombolHapusMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 89, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(80, 80, 80)
                        .addComponent(tombolKembalikanMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 111, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );
        tabMenuLayout.setVerticalGroup(
            tabMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(tabMenuLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelMenu)
                .addGap(35, 35, 35)
                .addComponent(jScrollPane31, javax.swing.GroupLayout.PREFERRED_SIZE, 163, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 111, Short.MAX_VALUE)
                .addGroup(tabMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tombolTambahMenu)
                    .addComponent(tombolHapusMenu)
                    .addComponent(tombolKembalikanMenu))
                .addContainerGap())
        );

        tabDataAdmin.addTab("Menu", tabMenu);

        tabDivisi.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        labelDivisi.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        labelDivisi.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelDivisi.setText("Divisi");
        tabDivisi.add(labelDivisi, new org.netbeans.lib.awtextra.AbsoluteConstraints(350, 10, -1, -1));

        tabelDivisi.setAutoCreateRowSorter(true);
        tabelDivisi.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null},
                {null, null}
            },
            new String [] {
                "Id Divisi", "Nama Divisi"
            }
        ));
        tabelDivisi.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelDivisiMouseClicked(evt);
            }
        });
        jScrollPane34.setViewportView(tabelDivisi);

        tabDivisi.add(jScrollPane34, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 710, 160));

        tombolTambahDivisi.setText("Tambah");
        tombolTambahDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolTambahDivisiActionPerformed(evt);
            }
        });
        tabDivisi.add(tombolTambahDivisi, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 340, 92, -1));

        tombolHapusDivisi.setText("Hapus");
        tombolHapusDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolHapusDivisiActionPerformed(evt);
            }
        });
        tabDivisi.add(tombolHapusDivisi, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 340, 92, -1));

        tombolKembalikanDivisi.setText("Kembalikan");
        tombolKembalikanDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembalikanDivisiActionPerformed(evt);
            }
        });
        tabDivisi.add(tombolKembalikanDivisi, new org.netbeans.lib.awtextra.AbsoluteConstraints(520, 340, 100, -1));

        tabDataAdmin.addTab("Divisi", tabDivisi);

        tabPegawai.setLayout(new org.netbeans.lib.awtextra.AbsoluteLayout());

        labelPegawai.setFont(new java.awt.Font("Tahoma", 0, 14)); // NOI18N
        labelPegawai.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        labelPegawai.setText("Pegawai");
        tabPegawai.add(labelPegawai, new org.netbeans.lib.awtextra.AbsoluteConstraints(320, 10, 90, -1));

        tombolTambahPegawai.setText("Tambah");
        tombolTambahPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolTambahPegawaiActionPerformed(evt);
            }
        });
        tabPegawai.add(tombolTambahPegawai, new org.netbeans.lib.awtextra.AbsoluteConstraints(130, 340, 91, -1));

        tombolHapusPegawai.setText("Hapus");
        tombolHapusPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolHapusPegawaiActionPerformed(evt);
            }
        });
        tabPegawai.add(tombolHapusPegawai, new org.netbeans.lib.awtextra.AbsoluteConstraints(330, 340, 91, -1));

        tabelPegawai.setAutoCreateRowSorter(true);
        tabelPegawai.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null},
                {null, null, null, null, null}
            },
            new String [] {
                "Id Pegawai", "Nama Pegawai", "Divisi", "Username", "Password"
            }
        ));
        tabelPegawai.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                tabelPegawaiMouseClicked(evt);
            }
        });
        jScrollPane44.setViewportView(tabelPegawai);

        tabPegawai.add(jScrollPane44, new org.netbeans.lib.awtextra.AbsoluteConstraints(10, 60, 710, 160));

        tombolKembalikanPegawai.setText("Kembalikan");
        tombolKembalikanPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembalikanPegawaiActionPerformed(evt);
            }
        });
        tabPegawai.add(tombolKembalikanPegawai, new org.netbeans.lib.awtextra.AbsoluteConstraints(500, 340, 110, -1));

        tabDataAdmin.addTab("Pegawai", tabPegawai);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(378, 378, 378)
                .addComponent(labelFrameAdmin)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 200, Short.MAX_VALUE)
                .addComponent(tombolKeluarAdmin)
                .addGap(103, 103, 103))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(tabDataAdmin, javax.swing.GroupLayout.PREFERRED_SIZE, 738, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(47, 47, 47))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelFrameAdmin)
                    .addComponent(tombolKeluarAdmin))
                .addGap(31, 31, 31)
                .addComponent(tabDataAdmin, javax.swing.GroupLayout.PREFERRED_SIZE, 407, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(84, Short.MAX_VALUE))
        );

        jPanel1.setBounds(0, 0, 840, 560);
        jDesktopPane1.add(jPanel1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        inFramePengisianKategori.setTitle("Pengisian Kategori Menu");
        inFramePengisianKategori.setVisible(false);

        labelPengisianKategori.setText("Pengisian Kategori Menu ");

        labelIdKat.setText("id kategori");

        labelNamaKat.setText("nama kategori");

        tombolSimpanPengisianKategori.setText("Simpan");
        tombolSimpanPengisianKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolSimpanPengisianKategoriActionPerformed(evt);
            }
        });

        tombolKembaliPengisianKategori.setText("Kembali");
        tombolKembaliPengisianKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembaliPengisianKategoriActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout inFramePengisianKategoriLayout = new javax.swing.GroupLayout(inFramePengisianKategori.getContentPane());
        inFramePengisianKategori.getContentPane().setLayout(inFramePengisianKategoriLayout);
        inFramePengisianKategoriLayout.setHorizontalGroup(
            inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianKategoriLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelIdKat)
                    .addComponent(labelNamaKat))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 63, Short.MAX_VALUE)
                .addGroup(inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textIdKategori, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textNamaKategori, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43))
            .addGroup(inFramePengisianKategoriLayout.createSequentialGroup()
                .addGap(193, 193, 193)
                .addComponent(labelPengisianKategori)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inFramePengisianKategoriLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(tombolSimpanPengisianKategori)
                .addGap(105, 105, 105)
                .addComponent(tombolKembaliPengisianKategori)
                .addGap(141, 141, 141))
        );
        inFramePengisianKategoriLayout.setVerticalGroup(
            inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianKategoriLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelPengisianKategori)
                .addGap(27, 27, 27)
                .addGroup(inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelIdKat)
                    .addComponent(textIdKategori, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNamaKat)
                    .addComponent(textNamaKategori, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 101, Short.MAX_VALUE)
                .addGroup(inFramePengisianKategoriLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tombolKembaliPengisianKategori)
                    .addComponent(tombolSimpanPengisianKategori))
                .addGap(27, 27, 27))
        );

        inFramePengisianKategori.setBounds(127, 51, 560, 310);
        jDesktopPane1.add(inFramePengisianKategori, javax.swing.JLayeredPane.DEFAULT_LAYER);

        inFramePengisianMenu.setTitle("Pengisian Menu");
        inFramePengisianMenu.setVisible(false);

        labelPengisianMenu.setText("Pengisian Menu");

        labelIdMenu.setText("id menu          ");

        labelNamaMenu.setText("nama menu     ");

        labelKategori.setText("kategori ");

        labelHarga.setText("harga menu     ");

        comboKategori.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                comboKategoriMouseClicked(evt);
            }
        });
        comboKategori.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboKategoriActionPerformed(evt);
            }
        });

        tombolSimpanPengisianMenu.setText("Simpan");
        tombolSimpanPengisianMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolSimpanPengisianMenuActionPerformed(evt);
            }
        });

        tombolKembaliPengisianMenu.setText("Kembali");
        tombolKembaliPengisianMenu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembaliPengisianMenuActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout inFramePengisianMenuLayout = new javax.swing.GroupLayout(inFramePengisianMenu.getContentPane());
        inFramePengisianMenu.getContentPane().setLayout(inFramePengisianMenuLayout);
        inFramePengisianMenuLayout.setHorizontalGroup(
            inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianMenuLayout.createSequentialGroup()
                .addGap(46, 46, 46)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(inFramePengisianMenuLayout.createSequentialGroup()
                        .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelIdMenu)
                            .addComponent(labelNamaMenu)
                            .addComponent(labelKategori)
                            .addComponent(labelHarga))
                        .addGap(32, 32, 32)
                        .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(textIdMenu)
                            .addComponent(textNamaMenu)
                            .addComponent(comboKategori, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(textHarga)))
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, inFramePengisianMenuLayout.createSequentialGroup()
                        .addGap(91, 91, 91)
                        .addComponent(tombolSimpanPengisianMenu)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(tombolKembaliPengisianMenu)
                        .addGap(67, 67, 67)))
                .addGap(51, 51, 51))
            .addGroup(inFramePengisianMenuLayout.createSequentialGroup()
                .addGap(224, 224, 224)
                .addComponent(labelPengisianMenu)
                .addContainerGap(231, Short.MAX_VALUE))
        );
        inFramePengisianMenuLayout.setVerticalGroup(
            inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianMenuLayout.createSequentialGroup()
                .addComponent(labelPengisianMenu)
                .addGap(26, 26, 26)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelIdMenu, javax.swing.GroupLayout.PREFERRED_SIZE, 22, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textIdMenu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(15, 15, 15)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textNamaMenu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelNamaMenu))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(comboKategori, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelKategori))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelHarga)
                    .addComponent(textHarga, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 101, Short.MAX_VALUE)
                .addGroup(inFramePengisianMenuLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tombolSimpanPengisianMenu)
                    .addComponent(tombolKembaliPengisianMenu))
                .addGap(19, 19, 19))
        );

        inFramePengisianMenu.setBounds(124, 50, 560, 350);
        jDesktopPane1.add(inFramePengisianMenu, javax.swing.JLayeredPane.DEFAULT_LAYER);

        inFramePengisianDivisi.setTitle("Pengisian Divisi");
        inFramePengisianDivisi.setVisible(false);

        labelIdDivisi.setText("id divisi");

        labelNamaDivisi.setText("nama divisi");

        tombolSimpanPengisianDivisi.setText("Simpan");
        tombolSimpanPengisianDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolSimpanPengisianDivisiActionPerformed(evt);
            }
        });

        labelPengisianDivisi.setText("Pengisian Divisi ");

        tombolKembaliPengisianDivisi.setText("Kembali");
        tombolKembaliPengisianDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembaliPengisianDivisiActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout inFramePengisianDivisiLayout = new javax.swing.GroupLayout(inFramePengisianDivisi.getContentPane());
        inFramePengisianDivisi.getContentPane().setLayout(inFramePengisianDivisiLayout);
        inFramePengisianDivisiLayout.setHorizontalGroup(
            inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianDivisiLayout.createSequentialGroup()
                .addGap(29, 29, 29)
                .addGroup(inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelIdDivisi)
                    .addComponent(labelNamaDivisi))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 121, Short.MAX_VALUE)
                .addGroup(inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(textIdDivisi, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(textNamaDivisi, javax.swing.GroupLayout.PREFERRED_SIZE, 327, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(43, 43, 43))
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, inFramePengisianDivisiLayout.createSequentialGroup()
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addComponent(labelPengisianDivisi)
                .addGap(223, 223, 223))
            .addGroup(inFramePengisianDivisiLayout.createSequentialGroup()
                .addGap(165, 165, 165)
                .addComponent(tombolSimpanPengisianDivisi)
                .addGap(128, 128, 128)
                .addComponent(tombolKembaliPengisianDivisi)
                .addContainerGap(javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );
        inFramePengisianDivisiLayout.setVerticalGroup(
            inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianDivisiLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(labelPengisianDivisi)
                .addGap(27, 27, 27)
                .addGroup(inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelIdDivisi)
                    .addComponent(textIdDivisi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(23, 23, 23)
                .addGroup(inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNamaDivisi)
                    .addComponent(textNamaDivisi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 131, Short.MAX_VALUE)
                .addGroup(inFramePengisianDivisiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tombolSimpanPengisianDivisi)
                    .addComponent(tombolKembaliPengisianDivisi))
                .addGap(27, 27, 27))
        );

        inFramePengisianDivisi.setBounds(138, 64, 600, 340);
        jDesktopPane1.add(inFramePengisianDivisi, javax.swing.JLayeredPane.DEFAULT_LAYER);

        inFramePengisianPegawai.setTitle("Pengisian Pegawai");
        inFramePengisianPegawai.setVisible(false);

        labelPengisianPegawai.setText("Pengisian Pegawai");

        labelIdPegawai.setText("id pegawai");

        labelNamaPegawai.setText("nama pegawai");

        labelUsername.setText("username");

        labelPassword.setText("password");

        labelDivisiPegawai.setText("divisi");

        textIdPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textIdPegawaiActionPerformed(evt);
            }
        });

        comboDivisi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                comboDivisiActionPerformed(evt);
            }
        });

        tombolSimpanPengisianPegawai.setText("Simpan");
        tombolSimpanPengisianPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolSimpanPengisianPegawaiActionPerformed(evt);
            }
        });

        tombolKembaliPengisianPegawai.setText("Kembali");
        tombolKembaliPengisianPegawai.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                tombolKembaliPengisianPegawaiActionPerformed(evt);
            }
        });

        textPassword.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                textPasswordActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout inFramePengisianPegawaiLayout = new javax.swing.GroupLayout(inFramePengisianPegawai.getContentPane());
        inFramePengisianPegawai.getContentPane().setLayout(inFramePengisianPegawaiLayout);
        inFramePengisianPegawaiLayout.setHorizontalGroup(
            inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                        .addGap(60, 60, 60)
                        .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(labelIdPegawai)
                            .addComponent(labelNamaPegawai)
                            .addComponent(labelDivisiPegawai)
                            .addComponent(labelUsername)
                            .addComponent(labelPassword))
                        .addGap(55, 55, 55)
                        .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(textUsername, javax.swing.GroupLayout.DEFAULT_SIZE, 298, Short.MAX_VALUE)
                            .addComponent(textNamaPegawai)
                            .addComponent(textIdPegawai)
                            .addComponent(comboDivisi, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(textPassword)))
                    .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                        .addGap(214, 214, 214)
                        .addComponent(labelPengisianPegawai))
                    .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                        .addGap(140, 140, 140)
                        .addComponent(tombolSimpanPengisianPegawai)
                        .addGap(116, 116, 116)
                        .addComponent(tombolKembaliPengisianPegawai)))
                .addContainerGap(67, Short.MAX_VALUE))
        );
        inFramePengisianPegawaiLayout.setVerticalGroup(
            inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                .addComponent(labelPengisianPegawai)
                .addGap(18, 18, 18)
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(textIdPegawai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(labelIdPegawai))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelNamaPegawai)
                    .addComponent(textNamaPegawai, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(labelDivisiPegawai)
                    .addComponent(comboDivisi, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                        .addGap(20, 20, 20)
                        .addComponent(labelUsername))
                    .addGroup(inFramePengisianPegawaiLayout.createSequentialGroup()
                        .addGap(18, 18, 18)
                        .addComponent(textUsername, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(labelPassword)
                    .addComponent(textPassword, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 119, Short.MAX_VALUE)
                .addGroup(inFramePengisianPegawaiLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(tombolSimpanPengisianPegawai)
                    .addComponent(tombolKembaliPengisianPegawai))
                .addGap(21, 21, 21))
        );

        inFramePengisianPegawai.setBounds(113, 42, 580, 400);
        jDesktopPane1.add(inFramePengisianPegawai, javax.swing.JLayeredPane.DEFAULT_LAYER);

        getContentPane().add(jDesktopPane1, new org.netbeans.lib.awtextra.AbsoluteConstraints(0, 0, 840, 560));

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void tabelKategoriMenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelKategoriMenuMouseClicked
        // TODO add your handling code here:

        int baris = tabelKategoriMenu.getSelectedRow();
        String id = tabelKategoriMenu.getValueAt(baris, 0).toString();
        String nm = tabelKategoriMenu.getValueAt(baris, 1).toString();
        textIdKategori.setText(id);
        textNamaKategori.setText(nm);
        tombolTambahKategori.setText("Edit");

    }//GEN-LAST:event_tabelKategoriMenuMouseClicked

    private void tombolTambahKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolTambahKategoriActionPerformed
        if (tombolTambahKategori.getText().equalsIgnoreCase("Tambah")) {
            try {
                textIdKategori.setText(AdminKontrol.getKoneksiKategori().carikodekategori());

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianKategori.setVisible(true);

    }//GEN-LAST:event_tombolTambahKategoriActionPerformed

    private void tombolHapusKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolHapusKategoriActionPerformed
        // TODO add your handling code here:
        int baris = tabelKategoriMenu.getSelectedRow();
        KategoriMenu kat = new KategoriMenu();
        kat.setIdKategori(tabelKategoriMenu.getValueAt(baris, 0).toString());
        kat.setNamaKategori(tabelKategoriMenu.getValueAt(baris, 1).toString());
        int opsi = JOptionPane.showConfirmDialog(null, "Yakin Hapus ? ", "Konfirmasi", JOptionPane.YES_NO_OPTION);
        if (opsi == JOptionPane.YES_OPTION) {

            try {
                AdminKontrol.getKoneksiKategori().deleteKategoriMenu(kat);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
            tampilKategoriMenu();
        } else {
            tampilKategoriMenu();
        }
        textIdKategori.setText("");
        textNamaKategori.setText("");
    }//GEN-LAST:event_tombolHapusKategoriActionPerformed

    private void tombolKembalikanKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembalikanKategoriActionPerformed
        // TODO add your handling code here:
        tombolTambahKategori.setText("Tambah");
        textIdKategori.setText("");
        textNamaKategori.setText("");
    }//GEN-LAST:event_tombolKembalikanKategoriActionPerformed

    private void tabelMenuMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelMenuMouseClicked
        // TODO add your handling code here:
        int baris = tabelMenu.getSelectedRow();
        String id = tabelMenu.getValueAt(baris, 0).toString();
        String nm = tabelMenu.getValueAt(baris, 1).toString();
        String kat = tabelMenu.getValueAt(baris, 2).toString();
        Long harga = Long.valueOf(tabelMenu.getValueAt(baris, 3).toString());
        textIdMenu.setText(id);
        textNamaMenu.setText(nm);
        textHarga.setText(String.valueOf(harga));
        comboKategori.setSelectedItem(kat);
        comboKategori.setEditable(false);
        tombolTambahMenu.setText("Edit");
    }//GEN-LAST:event_tabelMenuMouseClicked

    private void tombolTambahMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolTambahMenuActionPerformed
        // TODO add your handling code here:
        comboKategori.setEditable(true);
        inFramePengisianMenu.setVisible(true);
    }//GEN-LAST:event_tombolTambahMenuActionPerformed

    private void tombolKembalikanMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembalikanMenuActionPerformed
        // TODO add your handling code here:
        tombolTambahMenu.setText("Tambah");
        textIdMenu.setText("");
        textNamaMenu.setText("");
        textHarga.setText("");
    }//GEN-LAST:event_tombolKembalikanMenuActionPerformed

    private void tombolHapusMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolHapusMenuActionPerformed
        // TODO add your handling code here:
        int baris = tabelMenu.getSelectedRow();
//        KategoriMenu kat = new KategoriMenu();
//        kat.setIdKategori((tabelMenu.getValueAt(baris, 2).toString()).substring(0,3));
//        kat.setNamaKategori((tabelDivisi.getValueAt(baris, 2).toString()).substring(5));
        Menu mn = new Menu();
        mn.setIdMenu(tabelMenu.getValueAt(baris, 0).toString());
//        mn.setNamaMenu(tabelMenu.getValueAt(baris, 1).toString());
//        mn.setHargaMenu(Long.parseLong(tabelMenu.getValueAt(baris, 3).toString()));
//        mn.setKategori(kat);
        int opsi = JOptionPane.showConfirmDialog(null, "Yakin Hapus ? ", "Konfirmasi", JOptionPane.YES_NO_OPTION);
        if (opsi == JOptionPane.YES_OPTION) {

            try {
                AdminKontrol.getKoneksiKategori().deleteMenu(mn);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
            tampilMenu();
        } else {
            tampilMenu();
        }
        textIdMenu.setText("");
        textNamaMenu.setText("");
        textHarga.setText("");
    }//GEN-LAST:event_tombolHapusMenuActionPerformed

    private void tabelDivisiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelDivisiMouseClicked
        // TODO add your handling code here:
        int baris = tabelDivisi.getSelectedRow();
        String id = tabelDivisi.getValueAt(baris, 0).toString();
        String nm = tabelDivisi.getValueAt(baris, 1).toString();
        textIdDivisi.setText(id);
        textNamaDivisi.setText(nm);
        tombolTambahDivisi.setText("Edit");
    }//GEN-LAST:event_tabelDivisiMouseClicked

    private void tombolTambahDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolTambahDivisiActionPerformed
        // TODO add your handling code here:
        if (tombolTambahDivisi.getText().equalsIgnoreCase("Tambah")) {
            try {
                textIdDivisi.setText(AdminKontrol.getKoneksiKategori().carikodedivisi());

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianDivisi.setVisible(true);
    }//GEN-LAST:event_tombolTambahDivisiActionPerformed

    private void tombolHapusDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolHapusDivisiActionPerformed
       
                int baris = tabelDivisi.getSelectedRow();
        Divisi div = new Divisi();
        div.setIdDivisi(tabelDivisi.getValueAt(baris, 0).toString());
        div.setNamaDivisi(tabelDivisi.getValueAt(baris, 1).toString());
        int opsi = JOptionPane.showConfirmDialog(null, "Yakin Hapus ? ", "Konfirmasi", JOptionPane.YES_NO_OPTION);
        if (opsi == JOptionPane.YES_OPTION) {

            try {
                AdminKontrol.getKoneksiKategori().deleteDivisiPegawai(div);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
            tampilDivisi();
        } else {
            tampilDivisi();
        }
        textIdDivisi.setText("");
        textNamaDivisi.setText("");
    }//GEN-LAST:event_tombolHapusDivisiActionPerformed

    private void tombolKembalikanDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembalikanDivisiActionPerformed
        // TODO add your handling code here:
        tombolTambahDivisi.setText("Tambah");
        textIdDivisi.setText("");
        textNamaDivisi.setText("");
    }//GEN-LAST:event_tombolKembalikanDivisiActionPerformed

    private void tombolTambahPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolTambahPegawaiActionPerformed
        // TODO add your handling code here:
        comboDivisi.setEditable(true);
        inFramePengisianPegawai.setVisible(true);
    }//GEN-LAST:event_tombolTambahPegawaiActionPerformed

    private void tombolHapusPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolHapusPegawaiActionPerformed
        // TODO add your handling code here:
        int baris = tabelPegawai.getSelectedRow();
//        Divisi div = new Divisi();
//        div.setIdDivisi((tabelPegawai.getValueAt(baris, 2).toString()).substring(0,3));
//        div.setNamaDivisi((tabelPegawai.getValueAt(baris, 2).toString()).substring(5));
        Pegawai peg = new Pegawai();
        peg.setIdPegawai(tabelPegawai.getValueAt(baris, 0).toString());
//        peg.setNamaPegawai(tabelPegawai.getValueAt(baris, 1).toString());
//        peg.setDivisi(div);
//        peg.setUsername(tabelPegawai.getValueAt(baris, 3).toString());
//        peg.setPassword(tabelPegawai.getValueAt(baris, 4).toString());
        int opsi = JOptionPane.showConfirmDialog(null, "Yakin Hapus ? ", "Konfirmasi", JOptionPane.YES_NO_OPTION);
        if (opsi == JOptionPane.YES_OPTION) {

            try {
                AdminKontrol.getKoneksiKategori().deletePegawai(peg);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
            tampilPegawai();
        } else {
            tampilPegawai();
        }
        textIdPegawai.setText("");
        textNamaPegawai.setText("");
        textUsername.setText("");
        textPassword.setText("");
    }//GEN-LAST:event_tombolHapusPegawaiActionPerformed

    private void tabelPegawaiMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_tabelPegawaiMouseClicked
        // TODO add your handling code here:
        int baris = tabelPegawai.getSelectedRow();
        String id = tabelPegawai.getValueAt(baris, 0).toString();
        String nm = tabelPegawai.getValueAt(baris, 1).toString();
        String div = tabelPegawai.getValueAt(baris, 2).toString();
        String user = tabelPegawai.getValueAt(baris, 3).toString();
        String pass = tabelPegawai.getValueAt(baris, 4).toString();
        textIdPegawai.setText(id);
        textNamaPegawai.setText(nm);
        comboDivisi.setSelectedItem(div);
        comboDivisi.setEditable(false);
        textUsername.setText(user);
        textPassword.setText(pass);
        tombolTambahPegawai.setText("Edit");
    }//GEN-LAST:event_tabelPegawaiMouseClicked

    private void tombolKembalikanPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembalikanPegawaiActionPerformed
        // TODO add your handling code here:
        tombolTambahPegawai.setText("Tambah");
        textIdPegawai.setText("");
        textNamaPegawai.setText("");
        textUsername.setText("");
        textPassword.setText("");
    }//GEN-LAST:event_tombolKembalikanPegawaiActionPerformed

    private void tombolKembaliPengisianKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembaliPengisianKategoriActionPerformed
        // TODO add your handling code here:
        inFramePengisianKategori.setVisible(false);
        textIdKategori.setText("");
        textNamaKategori.setText("");
    }//GEN-LAST:event_tombolKembaliPengisianKategoriActionPerformed

    private void tombolKembaliPengisianMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembaliPengisianMenuActionPerformed
        // TODO add your handling code here:
        inFramePengisianMenu.setVisible(false);
        textIdMenu.setText("");
        textNamaMenu.setText("");
        textHarga.setText("");
    }//GEN-LAST:event_tombolKembaliPengisianMenuActionPerformed

    private void tombolKembaliPengisianDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembaliPengisianDivisiActionPerformed
        // TODO add your handling code here:
        inFramePengisianDivisi.setVisible(false);
        textIdDivisi.setText("");
        textNamaDivisi.setText("");
    }//GEN-LAST:event_tombolKembaliPengisianDivisiActionPerformed

    private void textIdPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textIdPegawaiActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textIdPegawaiActionPerformed

    private void tombolKembaliPengisianPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKembaliPengisianPegawaiActionPerformed
        // TODO add your handling code here:
        inFramePengisianPegawai.setVisible(false);
        textIdPegawai.setText("");
        textNamaPegawai.setText("");
        textUsername.setText("");
        textPassword.setText("");
    }//GEN-LAST:event_tombolKembaliPengisianPegawaiActionPerformed

    private void tombolKeluarAdminActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolKeluarAdminActionPerformed
        // TODO add your handling code here:
        this.dispose();
        HomePageDesktop home = new HomePageDesktop();
        home.setVisible(true);
    }//GEN-LAST:event_tombolKeluarAdminActionPerformed

    private void tombolSimpanPengisianKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolSimpanPengisianKategoriActionPerformed
        // TODO add your handling code here:
        KategoriMenu kat = new KategoriMenu();
        kat.setIdKategori(textIdKategori.getText());
        kat.setNamaKategori(textNamaKategori.getText());
        if (tombolTambahKategori.getText().equalsIgnoreCase("Tambah")) {
            try {
                AdminKontrol.getKoneksiKategori().insertKategoriMenu(kat);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            try {
                AdminKontrol.getKoneksiKategori().updateKategoriMenu(kat);

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianKategori.setVisible(false);
        textIdKategori.setText("");
        textNamaKategori.setText("");
        tombolTambahKategori.setText("Tambah");
        tampilKategoriMenu();
    }//GEN-LAST:event_tombolSimpanPengisianKategoriActionPerformed

    private void tombolSimpanPengisianPegawaiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolSimpanPengisianPegawaiActionPerformed
        // TODO add your handling code here:
        Divisi div = new Divisi();
        String kode = comboDivisi.getItemAt(comboDivisi.getSelectedIndex()).toString();
        String kodediv = kode.substring(0,3);
        div.setIdDivisi(kodediv);
        Pegawai peg = new Pegawai();
        peg.setIdPegawai(textIdPegawai.getText());
        peg.setNamaPegawai(textNamaPegawai.getText());
        peg.setDivisi(div);
        peg.setUsername(textUsername.getText());
        peg.setPassword(textPassword.getText());
        if (tombolTambahPegawai.getText().equalsIgnoreCase("Tambah")) {
            try {
                AdminKontrol.getKoneksiKategori().insertPegawai(peg);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            try {
                AdminKontrol.getKoneksiKategori().updatePegawai(peg);

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianPegawai.setVisible(false);
        textIdPegawai.setText("");
        textNamaPegawai.setText("");
        textUsername.setText("");
        textPassword.setText("");
        tombolTambahPegawai.setText("Tambah");
        tampilPegawai();
    }//GEN-LAST:event_tombolSimpanPengisianPegawaiActionPerformed

    private void tombolSimpanPengisianDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolSimpanPengisianDivisiActionPerformed
        // TODO add your handling code here:
                Divisi div = new Divisi();
        div.setIdDivisi(textIdDivisi.getText());
        div.setNamaDivisi(textNamaDivisi.getText());
        if (tombolTambahDivisi.getText().equalsIgnoreCase("Tambah")) {
            try {
                AdminKontrol.getKoneksiKategori().insertDivisiPegawai(div);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            try {
                AdminKontrol.getKoneksiKategori().updateDivisiPegawai(div);

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianDivisi.setVisible(false);
        textIdDivisi.setText("");
        textNamaDivisi.setText("");
        tombolTambahDivisi.setText("Tambah");
        tampilDivisi();
    }//GEN-LAST:event_tombolSimpanPengisianDivisiActionPerformed

    private void comboKategoriActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboKategoriActionPerformed
        // TODO add your handling code here:
        if(!tombolTambahMenu.getText().equalsIgnoreCase("Edit")){
        try {
            String fix = "";
            String kode = comboKategori.getItemAt(comboKategori.getSelectedIndex()).toString();
            String kd = kode.substring(0, 3);
            long tmbh = Long.parseLong(AdminKontrol.getKoneksiKategori().carikodemenu(kd));
            String tmbh1 = String.valueOf(tmbh);
            if (tmbh < 10) {
                String a = "00";
                fix = a + tmbh1;
                String jd = kd + fix;
                textIdMenu.setText(jd);
            } else if (tmbh < 100 && tmbh > 9) {
                String b = "0";
                fix = b + tmbh1;
                String jd = kd + fix;
                textIdMenu.setText(jd);
            } else if (tmbh > 99 && tmbh < 1000) {
                fix = String.valueOf(tmbh);
                String jd = kd + fix;
                textIdMenu.setText(jd);
            } else {
                JOptionPane.showMessageDialog(this, "JUMLAH BARANG KATEGORI TERSEBUT"
                    + "MAKSIMAL TIDAK DAPAT DITAMBAH LAGI!!");
                textIdMenu.setText("");
            }
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }} else {
            
        }
    }//GEN-LAST:event_comboKategoriActionPerformed

    private void tombolSimpanPengisianMenuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_tombolSimpanPengisianMenuActionPerformed
        // TODO add your handling code here:
        KategoriMenu kat = new KategoriMenu();
        String kode = comboKategori.getItemAt(comboKategori.getSelectedIndex()).toString();
        String kodekat = kode.substring(0,3);
        kat.setIdKategori(kodekat);
        Menu mn = new Menu();
        mn.setIdMenu(textIdMenu.getText());
        mn.setNamaMenu(textNamaMenu.getText());
        mn.setHargaMenu(Long.parseLong(textHarga.getText()));
        mn.setKategori(kat);
        if (tombolTambahMenu.getText().equalsIgnoreCase("Tambah")) {
            try {
                AdminKontrol.getKoneksiKategori().insertDataMenu(mn);
            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }

        } else {
            try {
                AdminKontrol.getKoneksiKategori().updateDataMenu(mn);

            } catch (SQLException ex) {
                Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
            }
        }
        inFramePengisianMenu.setVisible(false);
        textIdMenu.setText("");
        textNamaMenu.setText("");
        textHarga.setText("");
        tombolTambahMenu.setText("Tambah");
        tampilMenu();
    }//GEN-LAST:event_tombolSimpanPengisianMenuActionPerformed

    private void comboKategoriMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_comboKategoriMouseClicked
        // TODO add your handling code here:
//        try {
//            String fix = "";
//            String kode = comboKategori.getItemAt(comboKategori.getSelectedIndex()).toString();
//            String kd = kode.substring(0, 3);
//            long tmbh = Long.parseLong(AdminKontrol.getKoneksiKategori().carikodemenu(kd));
//            String tmbh1 = String.valueOf(tmbh);
//            if (tmbh < 10) {
//                String a = "00";
//                fix = a + tmbh1;
//                String jd = kd + fix;
//                textIdMenu.setText(jd);
//            } else if (tmbh < 100 && tmbh > 9) {
//                String b = "0";
//                fix = b + tmbh1;
//                String jd = kd + fix;
//                textIdMenu.setText(jd);
//            } else if (tmbh > 99 && tmbh < 1000) {
//                fix = String.valueOf(tmbh);
//                String jd = kd + fix;
//                textIdMenu.setText(jd);
//            } else {
//                JOptionPane.showMessageDialog(this, "JUMLAH BARANG KATEGORI TERSEBUT"
//                    + "MAKSIMAL TIDAK DAPAT DITAMBAH LAGI!!");
//                textIdMenu.setText("");
//            }
//        } catch (SQLException ex) {
//            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
//        }
    }//GEN-LAST:event_comboKategoriMouseClicked

    private void textPasswordActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_textPasswordActionPerformed
        // TODO add your handling code here:
    }//GEN-LAST:event_textPasswordActionPerformed

    private void comboDivisiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_comboDivisiActionPerformed
        // TODO add your handling code here:
        if(!tombolTambahPegawai.getText().equalsIgnoreCase("Edit")){ 
        try {
            String fix = "";
            String kode = comboDivisi.getItemAt(comboDivisi.getSelectedIndex()).toString();
            String kd = kode.substring(0, 3);
            long tmbh = Long.parseLong(AdminKontrol.getKoneksiKategori().carikodepegawai(kd));
            String tmbh1 = String.valueOf(tmbh);
            if (tmbh < 10) {
                String a = "00";
                fix = a + tmbh1;
                String jd = kd + fix;
                textIdPegawai.setText(jd);
            } else if (tmbh < 100 && tmbh > 9) {
                String b = "0";
                fix = b + tmbh1;
                String jd = kd + fix;
                textIdPegawai.setText(jd);
            } else if (tmbh > 99 && tmbh < 1000) {
                fix = String.valueOf(tmbh);
                String jd = kd + fix;
                textIdPegawai.setText(jd);
            } else {
                JOptionPane.showMessageDialog(this, "JUMLAH BARANG KATEGORI TERSEBUT"
                    + "MAKSIMAL TIDAK DAPAT DITAMBAH LAGI!!");
                textIdPegawai.setText("");
            }
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }} else {
            
        }
    }//GEN-LAST:event_comboDivisiActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(frameAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(frameAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(frameAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(frameAdmin.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new frameAdmin().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JComboBox comboDivisi;
    private javax.swing.JComboBox comboKategori;
    private javax.swing.JInternalFrame inFramePengisianDivisi;
    private javax.swing.JInternalFrame inFramePengisianKategori;
    private javax.swing.JInternalFrame inFramePengisianMenu;
    private javax.swing.JInternalFrame inFramePengisianPegawai;
    private javax.swing.JDesktopPane jDesktopPane1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JScrollPane jScrollPane30;
    private javax.swing.JScrollPane jScrollPane31;
    private javax.swing.JScrollPane jScrollPane34;
    private javax.swing.JScrollPane jScrollPane44;
    private javax.swing.JLabel labelDivisi;
    private javax.swing.JLabel labelDivisiPegawai;
    private javax.swing.JLabel labelFrameAdmin;
    private javax.swing.JLabel labelHarga;
    private javax.swing.JLabel labelIdDivisi;
    private javax.swing.JLabel labelIdKat;
    private javax.swing.JLabel labelIdMenu;
    private javax.swing.JLabel labelIdPegawai;
    private javax.swing.JLabel labelKategori;
    private javax.swing.JLabel labelKategoriMenu;
    private javax.swing.JLabel labelMenu;
    private javax.swing.JLabel labelNamaDivisi;
    private javax.swing.JLabel labelNamaKat;
    private javax.swing.JLabel labelNamaMenu;
    private javax.swing.JLabel labelNamaPegawai;
    private javax.swing.JLabel labelPassword;
    private javax.swing.JLabel labelPegawai;
    private javax.swing.JLabel labelPengisianDivisi;
    private javax.swing.JLabel labelPengisianKategori;
    private javax.swing.JLabel labelPengisianMenu;
    private javax.swing.JLabel labelPengisianPegawai;
    private javax.swing.JLabel labelUsername;
    private javax.swing.JTabbedPane tabDataAdmin;
    private javax.swing.JPanel tabDivisi;
    private javax.swing.JPanel tabKategoriMenu;
    private javax.swing.JPanel tabMenu;
    private javax.swing.JPanel tabPegawai;
    private javax.swing.JTable tabelDivisi;
    private javax.swing.JTable tabelKategoriMenu;
    private javax.swing.JTable tabelMenu;
    private javax.swing.JTable tabelPegawai;
    private javax.swing.JTextField textHarga;
    private javax.swing.JTextField textIdDivisi;
    private javax.swing.JTextField textIdKategori;
    private javax.swing.JTextField textIdMenu;
    private javax.swing.JTextField textIdPegawai;
    private javax.swing.JTextField textNamaDivisi;
    private javax.swing.JTextField textNamaKategori;
    private javax.swing.JTextField textNamaMenu;
    private javax.swing.JTextField textNamaPegawai;
    private javax.swing.JPasswordField textPassword;
    private javax.swing.JTextField textUsername;
    private javax.swing.JButton tombolHapusDivisi;
    private javax.swing.JButton tombolHapusKategori;
    private javax.swing.JButton tombolHapusMenu;
    private javax.swing.JButton tombolHapusPegawai;
    private javax.swing.JButton tombolKeluarAdmin;
    private javax.swing.JButton tombolKembaliPengisianDivisi;
    private javax.swing.JButton tombolKembaliPengisianKategori;
    private javax.swing.JButton tombolKembaliPengisianMenu;
    private javax.swing.JButton tombolKembaliPengisianPegawai;
    private javax.swing.JButton tombolKembalikanDivisi;
    private javax.swing.JButton tombolKembalikanKategori;
    private javax.swing.JButton tombolKembalikanMenu;
    private javax.swing.JButton tombolKembalikanPegawai;
    private javax.swing.JButton tombolSimpanPengisianDivisi;
    private javax.swing.JButton tombolSimpanPengisianKategori;
    private javax.swing.JButton tombolSimpanPengisianMenu;
    private javax.swing.JButton tombolSimpanPengisianPegawai;
    private javax.swing.JButton tombolTambahDivisi;
    private javax.swing.JButton tombolTambahKategori;
    private javax.swing.JButton tombolTambahMenu;
    private javax.swing.JButton tombolTambahPegawai;
    // End of variables declaration//GEN-END:variables

    private void tampilKategoriMenu() {
        try {
            List<KategoriMenu> daftarkategori = AdminKontrol.getKoneksiKategori().tampilKategoriMenu();
            KategoriMenuTableModel model = new KategoriMenuTableModel(daftarkategori);
            tabelKategoriMenu.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
//
    private void tampilMenu() {
        try {
            List<Menu> daftarmenu = AdminKontrol.getKoneksiKategori().tampilMenu();
            MenuTableModel model = new MenuTableModel(daftarmenu);
            tabelMenu.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilDivisi() {
        try {
            List<Divisi> daftardivisi = AdminKontrol.getKoneksiKategori().tampilDivisiPegawai();
            DivisiTableModel model = new DivisiTableModel(daftardivisi);
            tabelDivisi.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

    private void tampilPegawai() {
        try {
            List<Pegawai> daftarpegawai = AdminKontrol.getKoneksiKategori().tampilPegawai();
            PegawaiTableModel model = new PegawaiTableModel(daftarpegawai);
            tabelPegawai.setModel(model);
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
//
    private void tampilComboKategori() {
        try {
            comboKategori.removeAllItems();
            List<KategoriMenu> daftarkategoris = AdminKontrol.getKoneksiKategori().tampilKategoriMenu();
            for (int i = 0; i < daftarkategoris.size(); i++) {
                KategoriMenu kategori = daftarkategoris.get(i);
                comboKategori.addItem(kategori.getIdKategori() + " " + kategori.getNamaKategori());
            }
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
//
    private void tampilComboDivisi() {
        try {
            comboDivisi.removeAllItems();
            List<Divisi> daftardivisis = AdminKontrol.getKoneksiKategori().tampilDivisiPegawai();
            for (int i = 0; i < daftardivisis.size(); i++) {
                Divisi divisi = daftardivisis.get(i);
                comboDivisi.addItem(divisi.getIdDivisi() + " " + divisi.getNamaDivisi());
            }
        } catch (SQLException ex) {
            Logger.getLogger(frameAdmin.class.getName()).log(Level.SEVERE, null, ex);
        }
    }
}
